package com.codeczx.mysimpletagimageview;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    ViewPager viewPager;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        viewPager = (ViewPager) findViewById(R.id.viewpager);
        List<View>list = new ArrayList<>();
        SimpleTagImageView simpleTagImageView1 = new SimpleTagImageView(this);
        simpleTagImageView1.setTagWidth(20);
        simpleTagImageView1.setCornerDistance(20);
        simpleTagImageView1.setTagOrientation(1);
        simpleTagImageView1.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
//        simpleTagImageView1.setImageResource(R.drawable.aaaa);
//        simpleTagImageView1.setScaleType(ImageView.ScaleType.CENTER_CROP);
        SimpleTagImageView simpleTagImageView2 = new SimpleTagImageView(this);
        simpleTagImageView2.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        simpleTagImageView2.setTagWidth(20);
        simpleTagImageView2.setCornerDistance(20);
        simpleTagImageView2.setTagOrientation(1);
//        simpleTagImageView2.setImageResource(R.drawable.aaaa);
//        simpleTagImageView2.setScaleType(ImageView.ScaleType.CENTER_CROP);
        SimpleTagImageView simpleTagImageView3 = new SimpleTagImageView(this);
        simpleTagImageView3.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        simpleTagImageView3.setTagWidth(20);
        simpleTagImageView3.setCornerDistance(20);
        simpleTagImageView3.setTagOrientation(1);
//        simpleTagImageView3.setImageResource(R.drawable.aaaa);
//        simpleTagImageView3.setScaleType(ImageView.ScaleType.CENTER_CROP);
        list.add(simpleTagImageView1);
        list.add(simpleTagImageView2);
        list.add(simpleTagImageView3);
        viewPager.setAdapter(new MyPagerAdapter(list));
//        Log.i("codeczx",getResources().getDisplayMetrics().densityDpi+"");
//        RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.activity_main);
//        SimpleTagImageView simpleTagImageView = new SimpleTagImageView(this);
//        simpleTagImageView.setTagOrientation(1);
//        simpleTagImageView.setTagWidth(20);
//        simpleTagImageView.setImageResource(R.drawable.aaaa);
//        relativeLayout.addView(simpleTagImageView);

    }
}
